#include "widget.h"
#include "ui_widget.h"
#include <QButtonGroup>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->radioButton->setChecked(true);
    QButtonGroup* b1 = new QButtonGroup(this);
    b1->addButton(ui->radioButton);
    b1->addButton(ui->radioButton_2);
    b1->addButton(ui->radioButton_3);
    QButtonGroup* b2 = new QButtonGroup(this);
    b2->addButton(ui->radioButton_4);
    b2->addButton(ui->radioButton_5);
    b2->addButton(ui->radioButton_6);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_radioButton_clicked(bool checked)
{
    if(checked)
        ui->label->setText("you choose:male");
}

void Widget::on_radioButton_2_clicked(bool checked)
{
   if(checked)
       ui->label->setText("you choose:female");
}

void Widget::on_radioButton_3_clicked(bool checked)
{
    if(checked)
        ui->label->setText("you choose:other");
}
